﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace SmartPlant.Model.DbContext
{
    /// <summary>
    /// 图纸，包括pid图
    ///</summary>
    [SugarTable("DRAWING")]
    public class Drawing :MetaDataEntity
    {
        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_ID", IsPrimaryKey = true)]
        public decimal DwgId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PROJ_ID")]
        public decimal ProjId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "SITE_ID")]
        public decimal SiteId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CHG_NUM")]
        public decimal ChgNum { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PLANT_ID")]
        public decimal PlantId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "UNIT_ID")]
        public decimal UnitId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "USER_NAME")]
        public string UserName { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_TYPE_ID")]
        public decimal DwgTypeId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CHG_STATUS")]
        public string ChgStatus { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CHG_DATE")]
        public DateTime? ChgDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_NUM")]
        public decimal? DwgNum { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CURR_REV_NUM")]
        public decimal? CurrRevNum { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_TITLE1")]
        public string DwgTitle1 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_TITLE2")]
        public string DwgTitle2 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_TITLE3")]
        public string DwgTitle3 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_NAME")]
        public string DwgName
        {
            get
            {
                return _DwgName;
            }
            set
            {
                _DwgName = value;
                OnPropertyChanged(nameof(DwgName));
            }

        }
        private string  _DwgName;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_PROP_BY")]
        public string VenPropBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_PROP_DATE")]
        public DateTime? VenPropDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_DSGN_BY")]
        public string VenDsgnBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_DSGN_DATE")]
        public DateTime? VenDsgnDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_DRWN_BY")]
        public string VenDrwnBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_DRWN_DATE")]
        public DateTime? VenDrwnDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_CK_BY")]
        public string VenCkBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_CK_DATE")]
        public DateTime? VenCkDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_APPR_BY")]
        public string VenApprBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VEN_APPR_DATE")]
        public DateTime? VenApprDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CL_CK_BY")]
        public string ClCkBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CL_CK_DATE")]
        public DateTime? ClCkDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CL_ENGR_BY")]
        public string ClEngrBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CL_ENGR_DATE")]
        public DateTime? ClEngrDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CL_APPR_BY")]
        public string ClApprBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CL_APPR_DATE")]
        public DateTime? ClApprDate { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "AREA_ID")]
        public decimal AreaId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "BMP_FILE_NAME")]
        public string BmpFileName { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "BMP_FILE_PATH")]
        public string BmpFilePath { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_DESC")]
        public string DwgDesc { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "OUTPUT_DWG_FMT_ID")]
        public decimal OutputDwgFmtId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PARENT_ID")]
        public decimal ParentId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REF_SUBJ_DESC")]
        public string RefSubjDesc { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "FORMAT_ID")]
        public decimal FormatId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_ID")]
        public decimal RevId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "ENG_PROJ_ID")]
        public decimal? EngProjId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "ENG_REF_ID")]
        public decimal? EngRefId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_KEY1_ID")]
        public decimal? DwgKey1Id { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_KEY2_ID")]
        public decimal? DwgKey2Id { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_KEY3_ID")]
        public decimal? DwgKey3Id { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_STYLE_ID")]
        public decimal? DwgStyleId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_COND1")]
        public string DwgCond1 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_COND2")]
        public string DwgCond2 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REPORT_TYPE_ID")]
        public decimal? ReportTypeId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "MERGE_RELEASE_FLG")]
        public string MergeReleaseFlg { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "TYPE_GEN")]
        public string TypeGen { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DOCUMENT_TYPE_ID")]
        public decimal DocumentTypeId { get; set; }

        #region 1

        [SugarColumn(IsIgnore = true)]
        public string dwgTypeName { set; get; }

        [SugarColumn(IsIgnore = true)]
        public string unitName { set; get; }

        [SugarColumn(IsIgnore = true)]
        public string plantName { set; get; }

        [SugarColumn(IsIgnore = true)]
        public string dwgudfc01 { set; get; }

        [SugarColumn(IsIgnore = true)]
        public string dwgudfc02 { set; get; }

        public bool IsModify { set; get; } = false;

        public UdfDrawing udf = new UdfDrawing();

        //public UdfDrawing UdfDrawing { set; get; }

        #endregion 1
    }
}
